import time

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
driver=webdriver.Firefox()
driver.get('http://10.59.9.14:7003/')
driver.find_element(By.XPATH,'//a[@href="/home/login.html"]').click()
time.sleep(5)
logintext=driver.find_element(By.CLASS_NAME,'reg-new').text
print(logintext)

driver.find_element(By.XPATH,'/html/body/div[4]/div/div[1]/div[2]/form/div[1]/span[2]/input').send_keys('13811033962')
driver.find_element(By.NAME,'password').send_keys('123456')
time.sleep(5)
driver.find_element(By.CSS_SELECTOR,'.finish-btn').click()
time.sleep(5)
log=driver.find_element(By.XPATH,'/html/body/div[1]/div/div[2]/ul/li[1]/a').text
print(log)

driver.find_element(By.XPATH,'/html/body/div[3]/div[2]/ul/li[1]/a').click()
time.sleep(2)

enter=driver.find_element(By.CLASS_NAME,'search-input')
enter.send_keys('手机')
enter.send_keys(Keys.ENTER)
time.sleep(2)

jieguo=driver.find_element(By.XPATH,'/html/body/div[4]/a[2]').text
print(jieguo)

driver.find_element(By.XPATH,'//img[@class="lazy" and @src="/uploads/images/20250718/fe4cd9cb407fd1fb4bbe2725daca6ae1.jpg"]').click()
time.sleep(2)

xie=driver.find_element(By.ID,'store_nums')
xie.clear()
xie.send_keys(2)
time.sleep(2)

driver.find_element(By.ID,'add-cart').click()
time.sleep(2)

driver.find_element(By.XPATH,'//a[@class="nav-settcart"]').click()
time.sleep(2)

driver.find_element(By.NAME,'id[]').click()
time.sleep(2)

driver.find_element(By.XPATH,'//a[@class="ask-btn"]').click()
time.sleep(2)
driver.quit()